package com.hd.tiyu.yuejian.Model;

import android.support.v4.media.MediaBrowserServiceCompat.Result;

import com.hd.tiyu.yuejian.Service.PhotoService;

import java.util.List;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by admin on 2017/10/30.
 */

public class PhotoModel {
    private Retrofit retrofit;
    public PhotoModel(){
        retrofit = new Retrofit.Builder()
                .baseUrl("http://172.24.10.175/workout/api.php/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public Call<ResponseBody> addpost(String userid, String title, MultipartBody.Part file ){
        PhotoService service=retrofit.create(PhotoService.class);
        return service.addpost(userid,title, file);
    }

}
